const o = { s: "test", n: 0 };
console.log(JSON.stringify(o, null, "---")); // {"a":{"name":"jam.green","age":12},"id":123}
